<?php
	require '../include/library.inc.php';
	require '../include/admin_login.inc.php';
	
	$product_id = intval($_GET['product_id']);
	$publish = intval($_GET['publish']);
	
	if($product_id) {
		$sql = "UPDATE 
				  products
				SET
				  published = $publish
				WHERE
				  product_id = $product_id 
				 ";
		query($sql);
	}
  
	redirect($_SERVER['HTTP_REFERER']);
?>